-
Notifications
You must be signed in to change notification settings - Fork 135
Narrow AdvancedCollectionView trimming warning so that it only triggers in unsafe usages #724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Arlodotexe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I'd like explicit approval from @Sergio0694 before we merge
Sergio0694
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a good way to fix this. This whole type would need to be reworked to be properly trim-safe. For instance, there's nothing enforcing that the T being used to create a sort descriptor will actually match the source type being used. Additionally annotating a T and then suppressing is not correct, the annotations should rather flow. As a rule of thumb, suppressions are almost always incorrect and should be avoided.
Sergio0694
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better than before but it's not entirely safe 😅
Fixes
Fixes #723
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Trimming warning triggers on every usage of AdvancedCollectionView
What is the new behavior?
Trimming warning only triggers when you make use of reflection-based sorting.
PR Checklist
Please check if your PR fulfills the following requirements:
Other information